<%@ page contentType="text/html;charset=utf-8" %>
<%@ page import="java.util.Date" %>
<%@ page import="ut.data.User" %>
<%@ page import="ut.res.Language" %>
<%
	User user = (User)session.getAttribute("user");
	if(user == null){
		response.sendRedirect("/");
		return;
	}
	if(user.verify == 0){
		response.sendRedirect("/");
		return;
	}
%>

<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>UT終極一翻！ | 建立免費案件</title>
	<link rel="stylesheet" type="text/css" href="/style.css" media="all" />
	<link rel="stylesheet" type="text/css" href="/css/task-create.css" media="all" />
	<script type="text/javascript" src="/js/Utility.js"></script>
	<script type="text/javascript" src="/js/Message.js"></script>
	<script type="text/javascript" src="/js/Ajax.js"></script>
	<script type="text/javascript" src="/js/Button.js"></script>
	<script type="text/javascript" src="/js/Account.js"></script>
	<script type="text/javascript" src="/js/FreeTask.js"></script>
	<script type="text/javascript" src="/script.js"></script>
</head>
<body onload="init();">
<%@ include file="/include/banner.jsp" %>
	<div class="content">
		<div class="title">建立免費案件</div>
		<form class="create-form block" onsubmit="FreeTask.create(this);return false;">
			<div class="create-content">
				<div class="create-element">
					<div class="create-element-left">案主：</div>
					<div class="create-element-right"><%= user.name %></div>
				</div>
				<div class="create-element">
					<div class="create-element-left">翻譯語言：</div>
					<div class="create-element-right">
						<div id="task-create-spec-selector" class="create-element">
							從
							<select name="fromLang">
<%
	Language[] langs = Language.getLanguages();
	for(int i = 0; i < langs.length; i++){
		out.println("<option value='" + langs[i].id + "'>" + langs[i].title + "</option>");
	}
%>
							</select>
							翻譯至
							<select name="toLang">
<%
	for(int i = 0; i < langs.length; i++){
		out.println("<option value='" + langs[i].id + "'>" + langs[i].title + "</option>");
	}
%>
							</select>
						</div>
					</div>
				</div>
				<div class="create-element">
					<div class="create-element-left">
						翻譯原文：
						<div class="mark-red comment">＊限 200 字元</div>
					</div>
					<div class="create-element-right">
						<textarea name="content"></textarea>
					</div>
				</div>
				<div class="create-element">
					<div class="create-element-left">案件有效期限：</div>
					<div class="create-element-right">
						建立成功後 30 天
						<div class="mark-red comment">＊超過有效期限將停止接受譯者回應</div>
					</div>
				</div>
				<div class="create-element">
					<div class="create-element-left">
						注意事項：
					</div>
					<div class="create-element-right">
						1. 您同意免費案件的原文和譯文內容都將無條件公開於本站。<br/>
						2. 您必須確保提供的翻譯原文內容沒有侵害任何第三方的著作權。<br/>
						3. 若不願意公開案件原文和譯文內容，請建立【<a target="_top" href="/task/task-create.jsp">付費案件</a>】。<br/><br/>
						<input type="checkbox" name="agree" />我已閱讀並同意上述注意事項。
					</div>
				</div>
				<div class="create-element">
					<div class="create-element-left create-element-button">
						<input name="submit" type="submit" class="button" value="建立"
							onmousedown="this.style.borderStyle='inset';"
							onmouseup="this.style.borderStyle='outset';"
							onmouseout="this.style.borderStyle='outset';" />
					</div>
					<div class="create-element-right create-element-button">
						<button type="button" class="button"
							onmousedown="this.style.borderStyle='inset';"
							onmouseup="this.style.borderStyle='outset';"
							onmouseout="this.style.borderStyle='outset';"
							onclick="document.location.href='/task-create-select.jsp'">
							取消
						</button>
					</div>
				</div>
				<div style="clear:both"></div>
			</div>
		</form>
<%@ include file="/include/foot.jsp" %>
	</div>
</body>
</html>